Skip to content

starknet_transaction_prover: add ServiceConfig validation tests#14049

Open
avi-starkware wants to merge 1 commit into
avi/privacy/cors-tests-v2from
avi/privacy/config-validation-tests-v2
Open

starknet_transaction_prover: add ServiceConfig validation tests#14049
avi-starkware wants to merge 1 commit into
avi/privacy/cors-tests-v2from
avi/privacy/config-validation-tests-v2

Conversation

@avi-starkware

Copy link
Copy Markdown
Collaborator

Adds unit tests for ServiceConfig::from_args covering: missing rpc_url
rejection, zero max_concurrent_requests / max_connections rejection,
mutual exclusion of --no-cors and --cors-allow-origin, --no-cors
clearing config-file origins, --skip-fee-field-validation propagating
to ProverConfig, config-file values being used when CLI flags are
absent, CLI flags overriding config-file values, and additional CORS
scheme/userinfo rejection at the config layer.

@reviewable-StarkWare

Copy link
Copy Markdown

This change is Reviewable

@cursor

cursor Bot commented May 17, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Test-only changes in config_test.rs; no production config or server behavior is modified.

Overview
Expands ServiceConfig::from_args coverage in config_test.rs with new validation and merge-behavior tests, and tightens existing CORS negative tests.

CORS: The single path-rejection test becomes an rstest parameterized suite (invalid path, non-HTTP scheme, userinfo) using assert_matches! instead of matches!.

New cases: Missing rpc_urlMissingRequiredField; zero max_concurrent_requests / max_connectionsInvalidArgument; --no-cors together with --cors-allow-origin → mutually exclusive error; --no-cors clears origins loaded from a config file; --skip-fee-field-validation sets prover_config.validate_zero_fee_fields to false; config file supplies port / ip when CLI omits them; CLI port overrides config file.

Reviewed by Cursor Bugbot for commit 38dd27c. Bugbot is set up for automated code reviews on this repo. Configure here.

@avi-starkware avi-starkware force-pushed the avi/privacy/config-validation-tests-v2 branch from 3bf5954 to 8600ded Compare May 17, 2026 17:39
@avi-starkware avi-starkware force-pushed the avi/privacy/cors-tests-v2 branch from 8aa40a1 to b5dba94 Compare May 17, 2026 17:39
@avi-starkware avi-starkware force-pushed the avi/privacy/config-validation-tests-v2 branch from 8600ded to 96bf8d9 Compare May 17, 2026 19:07
@avi-starkware avi-starkware force-pushed the avi/privacy/cors-tests-v2 branch 2 times, most recently from 9636c86 to 20c98e9 Compare May 20, 2026 08:33
@avi-starkware avi-starkware force-pushed the avi/privacy/config-validation-tests-v2 branch from 96bf8d9 to 056f406 Compare May 20, 2026 08:33
@avi-starkware avi-starkware force-pushed the avi/privacy/cors-tests-v2 branch from 20c98e9 to d437078 Compare May 31, 2026 10:39
@avi-starkware avi-starkware force-pushed the avi/privacy/config-validation-tests-v2 branch from 056f406 to 3a5608b Compare May 31, 2026 10:39
Adds unit tests for ServiceConfig::from_args covering: missing rpc_url
rejection, zero max_concurrent_requests / max_connections rejection,
mutual exclusion of --no-cors and --cors-allow-origin, --no-cors
clearing config-file origins, --skip-fee-field-validation propagating
to ProverConfig, config-file values being used when CLI flags are
absent, CLI flags overriding config-file values, and additional CORS
scheme/userinfo rejection at the config layer.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants